/*
 * @Author: Zhouhai 497675647@qq.com
 * @Date: 2022-10-08 11:47:37
 * @LastEditors: Zhouhai 497675647@qq.com
 * @LastEditTime: 2022-10-08 12:03:47
 */
import { CustomFormConfig } from "@/type.d/formItems";
import { ProFormDatePicker } from "@ant-design/pro-components";

export const RenderDate: (itemconfig: CustomFormConfig, disabled: boolean) => JSX.Element = (itemconfig, disabled) => {
    const placeholder = disabled ? "" : (itemconfig?.placeholder || `请输入${itemconfig.title}`);
    return <ProFormDatePicker
      placeholder={placeholder}
      key={itemconfig.fieldId}
      width="md"
      colProps={{ md: 8, xl: 6 }}
      name={itemconfig.fieldId}
      label={itemconfig.title}
    />
  }